import 'package:flutter/material.dart';
import '../utils/general.dart';

class FFPrice extends StatefulWidget {
  final double initPrice;
  FFPrice({Key key, this.initPrice = 21.0}):super(key:key);
  @override
  State<StatefulWidget> createState() {
    return FFPriceState();
  }
}

class FFPriceState extends State<FFPrice> {
  double price = 0.0;

  void ffUpdatePrice(double newP) {
    setState(() {
      price = newP;
    });
  }

  @override
  Widget build(BuildContext context) {

    double scale = widthScale(context);

    return Text(
      '￥${price > 0.0 ? price : widget.initPrice}',
      style:TextStyle(fontSize: 18 * scale, color:Colors.black87,),                  
    );
  }

}